package com.example.sp04.order.feign;

import com.tedu.sp01.pojo.User;
import com.tedu.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(name ="user-service",fallback =UserFeignClientFB.class)
public interface UserFeignClient {

    @GetMapping("/{userId}")
    public JsonResult<User> getUser(@PathVariable Integer userId);

    @GetMapping("/{userId}/score")
    public JsonResult addScore(
            @PathVariable Integer userId, Integer score);
}
